<template>
	<view class="content" id="game">
	</view>
</template>

<script>
	import {Preloader} from '../../common/game/main.js'
	import Phaser from 'phaser'
	export default {
		data() {
			return {
				title: 'Hello',
				game:null,
			}
		},
		mounted() {
			this.initGame();
		},
		onLoad() {

		},
		methods: {
			initGame() {
				this.game = new Phaser.Game({
					type: Phaser.WEBGL,
					backgroundColor: '#9bd4c3',
					width: 800,
					height: 600,
					parent: 'game',
					scene: [Preloader],
					// scene: [Preloader, Main, End],
				});

				function preload() {
					// 加载资源
					//this.game.load.image('hero','static/logo.png')
					
					
				}

				function create() {
					// 游戏初始化
					
				}

				function update() {
					// 游戏更新逻辑
				}
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>